package com.morningstar.common.message;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

/**
 * 我的待办任务消息
 *
 * @author morningstar
 */
@Getter
@Setter
public class FlowTaskTodoMessage extends AbstractMessage {

    /**
     * 我的待办任务消息模板KEY
     */
    public static final String FLOW_TASK_TODO_MESSAGE_TEMPLATE_KEY = "FLOW_TASK_TODO_MESSAGE";

    /**
     * 模板内容占位符
     * 流程名称
     */
    private static final String FLOW_NAME = "${flow_name}";

    /**
     * 模板内容占位符
     * 任务名称
     */
    private static final String FLOW_TASK_NAME = "${flow_task_name}";

    public FlowTaskTodoMessage(String title, Long targetUserId) {
        super(title, targetUserId, FLOW_TASK_TODO_MESSAGE_TEMPLATE_KEY, new HashMap<>(2));
    }

    public FlowTaskTodoMessage setFlowName(String flowName) {
        super.getParams().put(FLOW_NAME, flowName);
        return this;
    }

    public FlowTaskTodoMessage setFlowTaskName(String flowTaskName) {
        super.getParams().put(FLOW_TASK_NAME, flowTaskName);
        return this;
    }
}
